<?php

class msg_send{
public function index(){
$supplier_id = intval($GLOBALS['request']['supplier_id']);
$email = strim($GLOBALS['request']['email']);
$pwd = strim($GLOBALS['request']['pwd']);
$content = strim($GLOBALS['request']['content']);
$tel = strim($GLOBALS['request']['tel']);
$user = user_check($email,$pwd);
$user_id  = intval($user['id']);
if($user['id']<=0)
{
$root['user_login_status'] = 0;
$root['return']=0;
output($root);
}
$tel_msg_data['send_type'] = 0;
$tel_msg_data['content'] = addslashes($content);
$tel_msg_data['send_time'] = 0;
$tel_msg_data['is_send'] = 0;
$tel_msg_data['create_time'] = get_gmtime();
$tel_msg_data['user_id'] = $user_id;
$tel_msg_data['is_html'] = 0;
$tel_msg_data['is_youhui'] = 4;
$tel_list = explode(';',$tel);
foreach($tel_list as $k=>$v){
if(!empty($v)){
$tel_msg_data['dest'] = $v;
$GLOBALS['db']->autoExecute(DB_PREFIX.'deal_msg_list',$tel_msg_data,'INSERT');
}
}
$nums=mysql_affected_rows();
if($nums<=0)
{
$root['return']=0;
$root['info']='操作失败！';
output($root);
}
$root['return']=1;
output($root);
}
}
?>